package com.iwdnb.gkgz.application.collect.bean;


import java.time.LocalTime;

/**
 * @author wbc
 * @date 2020/11/08
 **/
public class TimePeriodResolver {

    private LocalTime startTime;

    private LocalTime endTime;

    public TimePeriodResolver(LocalTime startTime, LocalTime endTime) {
        this.startTime = startTime;
        this.endTime = endTime;
    }

    public boolean isCurrentTimePeriod(){
        LocalTime now = LocalTime.now();

        boolean afterStartTime = now.isAfter(startTime);
        boolean beforeEndTime = now.isBefore(endTime);

        return afterStartTime && beforeEndTime;
    }

}
